home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr50 / aabas11.zip / AABAS.DOC < prev    next >
Text File  |  1993-05-19  |  36KB  |  1,206 lines

  1.          The Affordable Alternative Library for BASIC
  2.          =------------------------------------------=
  3.                          Version 1.1
  4.  
  5.      AABas  Copyright (c) 1992-1993  Thomas G. Hanlin III
  6.  
  7.  
  8.  
  9. This is a library for QuickBASIC 4.0 - 4.5.  It provides easy
  10. access to BIOS and DOS calls, covering display and keyboard,
  11. mouse, joystick, disk, printer, equipment information, XMS
  12. memory, and more.
  13.  
  14. AABas is copyrighted and may be distributed only according to
  15. the following rule:
  16.  
  17.    All AABas files must be distributed together as a unit.
  18.    No files may be left out, added, or altered.
  19.  
  20. You may recognize my name-- I've written more than a few
  21. libraries, ranging from $25-$35 shareware products to $200
  22. commercial libraries.  I've abandoned the commercial arena,
  23. though, since I consider its prices obscene.  Lately it's
  24. occurred to me that $25-$35 may also be a major outlay for some
  25. people.  There have been times I haven't be able to handle that
  26. much, anyway.  Enter AABas: an affordable library which
  27. nonetheless provides many useful functions.  You can register
  28. AABas for only $8, including postage and handling.  This gets
  29. you to the latest version of AABas, complete with full source
  30. code in assembly language.  See ORDER.FRM for details.
  31.  
  32. You use this library at your own risk.  It has been tested by
  33. me on my own computer, but I will not assume any responsibility
  34. for any problems which AABas may cause you.  If you do
  35. encounter a problem, please let me know about it, and I will do
  36. my best to verify and repair the error.
  37.  
  38.                          Using AABas
  39.  
  40.  
  41.  
  42. The .QLB that comes with AABas was created with QuickBASIC 4.5.
  43. If you have one of the QuickBASIC 4.0 releases, you can still
  44. use AABas, but you must create a new .QLB file.  The following
  45. will do the trick:
  46.  
  47.    LINK AABAS.LIB/Q,AABAS.QLB,NUL,BQLB40
  48.  
  49. For some later releases of QB 4.0, you will need to specify
  50. BQLB41 instead of BQLB40.  Check your QB files to see whether
  51. you have BQLB40.LIB or BQLB41.LIB.
  52.  
  53. To use AABas routines, you must include the AABAS.BI file in
  54. your program.  You can do this directly with a text editor, if
  55. you like.  A simpler approach would be to place this line at
  56. the start of your program:
  57.  
  58.    REM $INCLUDE: 'AABAS.BI'
  59.  
  60. If you compile from the command line, using BC, you must
  61. specify AABas as a library when you LINK the program.  You can
  62. let LINK prompt you for what it wants or type in the entire set
  63. of parameters at once, like this:
  64.  
  65.    LINK program/EX,,NUL,AABAS
  66.  
  67. If you compile using the QuickBASIC environment, you must
  68. specify AABas as a library when you load QB:
  69.  
  70.    QB program /L AABAS
  71.  
  72. In this case, the program name is optional.  Once in the QB
  73. environment, you can load an existing program or create a new
  74. one.  The /L AABAS switch allows you to use AABas routines.
  75.  
  76.                         Assorted Notes
  77.  
  78.  
  79.  
  80. These routines are broken into two rough categories: BIOS and
  81. DOS.  I've included a few sets of routines in the BIOS category
  82. which perhaps don't entirely belong there: mouse and XMS memory
  83. routines.  Still, close enough.
  84.  
  85. The routines in the BIOS category will work on just about any
  86. machine, with the exception of a few of the odder and older
  87. machines.  How old is older?  Say, before mid-1984.  In other
  88. words, compatibility is not much of a problem.
  89.  
  90. The DOS routines will work on any machine that runs DOS 2.11 or
  91. later releases.  Compatibility is no problem at all there.
  92.  
  93. The source code for AABas is entirely in MASM-compatible
  94. assembly language.  They require negligible space in your
  95. program, and may even reduce the size of your program if their
  96. use allows BASIC to remove some of its own support code from
  97. the program.
  98.  
  99. The AABas library is based directly on BIOS and DOS routines,
  100. with no attempt to provide anything more fancy.  The library is
  101. intended to be small, convenient, and inexpensive-- just the
  102. thing for folks learning about libraries for the first time or
  103. on a budget.  You will find AABas quite powerful within these
  104. limitations.  If you find you need something a little more
  105. comprehensive, you may wish to examine my BasWiz and PBClone
  106. libraries.  See the CATALOG.TXT file for more information.
  107.  
  108. Please note that the AABas disk and file routines do not
  109. provide critical error handling.  If you expect to use them
  110. with drives which are prone to critical errors (drive door
  111. open, disk not formatted, etc-- the kind of errors which tend
  112. to happen on drives with removable media), you should provide
  113. your own ON ERROR handler.  Otherwise, depending on what the
  114. user answers to the "A>bort, R>etry, I>gnore, F>ail?" message,
  115. your program could be abruptly terminated by a critical error.
  116. If you have an ON ERROR handler, you can take care of such
  117. things in your program, rather than letting DOS handle it.
  118.  
  119.                         Reference List
  120.  
  121.  
  122.  
  123. BiosAlt%        return whether an ALT key is pressed
  124. BiosBaseMem%    return amount of base memory installed
  125. BiosCaps%       return whether CapsLock is on
  126. BiosCheckKey$   get key from keyboard buffer, if any
  127. BiosChkPrt%     check a printer
  128. BiosComPorts%   return the number of com (serial) ports
  129. BiosCtrl%       return whether a CTRL key is pressed
  130. BiosELAlt%      return whether Left ALT is pressed
  131. BiosELCtrl%     return whether Left CTRL is pressed
  132. BiosERAlt%      return whether Right ALT is pressed
  133. BiosERCtrl%     return whether Right CTRL is pressed
  134. BiosESysRq%     return whether SysRq is pressed
  135. BiosFloppies%   return the number of floppy drives
  136. BiosGetKeyW$    get a key from the keyboard (wait if need be)
  137. BiosGetVideo    get the screen width, mode, and active page
  138. BiosInitPrt%    initialize a printer
  139. BiosIns%        return whether Insert is on
  140. BiosJoyPosn     get joystick positions
  141. BiosJoyPress    get joystick buttons
  142. BiosKeyIn%      stuff a key into the keyboard buffer
  143. BiosKeyRep      change the key repeat rate
  144. BiosLShift%     return whether Left SHIFT is pressed
  145. BiosMHide       hide the mouse cursor
  146. BiosMInit%      initialize the mouse, return # of buttons
  147. BiosMLButton%   return whether left mouse button is pressed
  148. BiosMLClick     return left clicks & position at last click
  149. BiosMLocate     set the mouse cursor position
  150. BiosMLRelease   return left releases & pos'n at last release
  151. BiosMMButton%   return whether middle mouse button is pressed
  152. BiosMMClick     return middle clicks & pos'n at last click
  153. BiosMMRelease   return middle releases & pos'n at last release
  154. BiosMRButton%   return whether right mouse button is pressed
  155. BiosMRClick     return right clicks & position at last click
  156. BiosMRRelease   return right releases & pos'n at last release
  157. BiosMShow       make the mouse cursor visible
  158. BiosMWhereX%    return the X coordinate of the mouse cursor
  159. BiosMWhereY%    return the Y coordinate of the mouse cursor
  160. BiosMWindow     set the allowed range for the mouse cursor
  161. BiosNum%        return whether NumLock is on
  162. BiosPrintCh%    print a character (to a printer)
  163. BiosPrtPorts%   return the number of printer (parallel) ports
  164. BiosPrtSc       print the screen on the default printer
  165. BiosRShift%     return whether Right SHIFT is pressed
  166. BiosScroll%     return whether ScrollLock is on
  167. BiosScrollDn    scroll an area of the screen down
  168. BiosScrollUp    scroll an area of the screen up
  169.  
  170.                         Reference List
  171.  
  172.  
  173.  
  174. BiosXClose      close an area of XMS
  175. BiosXExists%    see if XMS memory is available
  176. BiosXLFree&     return the largest block of XMS memory
  177. BiosXOpen       open an area of XMS for use
  178. BiosXRead       get information from XMS memory
  179. BiosXResize     resize an area of XMS memory
  180. BiosXTFree&     return the amount of available XMS memory
  181. BiosXVer%       get the XMS driver version
  182. BiosXWrite      put information into XMS memory
  183.  
  184. DosBreak%       return Break level
  185. DosBreakOff     minimize Break checking
  186. DosBreakOn      maximize Break checking
  187. DosDelDir%      delete a directory
  188. DosDelFile%     delete a file
  189. DosDiskInfo     get space & capacity info about a disk drive
  190. DosGetDay$      get the current day name
  191. DosGetDir$      get a default disk directory
  192. DosGetDisk$     get the default disk drive
  193. DosGetFAttr%    get the attributes of a file
  194. DosGetKey$      get a key from standard input
  195. DosGetKeyW$     get a key from standard input (wait if needed)
  196. DosGetVersion%  get the DOS version
  197. DosMakeDir%     create a directory
  198. DosRenFile%     rename a file and/or move it to a new directory
  199. DosSetDir%      set default directory
  200. DosSetDisk%     set the default disk drive
  201. DosSetFAttr%    set the attributes of a file
  202. DosVerify%      return disk write verification status
  203. DosVerifyOff    turn off disk write verification
  204. DosVerifyOn     turn on disk write verification
  205. DosWriteSt      write a string to standard output
  206.  
  207. BiosAlt%
  208.  
  209. This function tells you whether an Alt key is pressed.
  210.  
  211.    Alt% = BiosAlt%
  212.  
  213.  
  214.  
  215. BiosBaseMem%
  216.  
  217. This function returns the amount of base memory installed, in
  218. kilobytes.  These days, it will typically be 640.
  219.  
  220.    Kbytes% = BiosBaseMem%
  221.  
  222.  
  223.  
  224. BiosCaps%
  225.  
  226. This function tells you whether the CapsLock toggle is on.
  227.  
  228.    CapsLock% = BiosCaps%
  229.  
  230.  
  231.  
  232. BiosChkEKey$
  233.  
  234. This function reads a character from the keyboard.  It works
  235. like INKEY$, but doesn't take the key from the keyboard
  236. buffer.  This is useful for handling control characters
  237. (Ctrl-S, Ctrl-Q, Ctrl-C, etc)-- you can have your program
  238. recognize them if pressed, without disturbing the keyboard
  239. buffer if someone is using type-ahead.
  240.  
  241. Actually, it doesn't work quite like INKEY$ in another fashion
  242. which is to its advantage.  It always returns a zero or
  243. two-character string, where the first character is the ASCII
  244. code (CHR$(0) for extended keys, like function keys and arrow
  245. keys) and the second character is the scan code.  For normal
  246. keys, the scan code is always the same regardless of the shift
  247. state of the key. That is, the scan code for "A" is the scan
  248. code for "a" is the scan code for Ctrl-A is the scan code for
  249. Alt-A.  Rose is a rose is a rose, eh?  This is an occasionally
  250. useful property.
  251.  
  252. Note that this keyboard service is for "enhanced" keyboards
  253. only.  Use BiosChkKey$ for older keyboards.
  254.  
  255.    Ky$ = BiosChkEKey$
  256.  
  257. BiosChkKey$
  258.  
  259. This function reads a character from the keyboard.  It works
  260. like INKEY$, but doesn't take the key from the keyboard
  261. buffer.  This is useful for handling control characters
  262. (Ctrl-S, Ctrl-Q, Ctrl-C, etc)-- you can have your program
  263. recognize them if pressed, without disturbing the keyboard
  264. buffer if someone is using type-ahead.
  265.  
  266. Actually, it doesn't work quite like INKEY$ in another fashion
  267. which is to its advantage.  It always returns a zero or
  268. two-character string, where the first character is the ASCII
  269. code (CHR$(0) for extended keys, like function keys and arrow
  270. keys) and the second character is the scan code.  For normal
  271. keys, the scan code is always the same regardless of the shift
  272. state of the key. That is, the scan code for "A" is the scan
  273. code for "a" is the scan code for Ctrl-A is the scan code for
  274. Alt-A.  Rose is a rose is a rose, eh?  This is an occasionally
  275. useful property.
  276.  
  277. Note that this keyboard service, for reasons known only to IBM,
  278. is designed to ignore the new key codes for "enhanced"
  279. keyboards.  This means it won't detect F11 or F12, for
  280. instance.  Use BiosChkEKey$ for enhanced keyboards.
  281.  
  282.    Ky$ = BiosChkKey$
  283.  
  284.  
  285.  
  286. BiosChkPrt%
  287.  
  288. This function returns the status of the selected printer.
  289. Status information is encoded at the bit level, as follows:
  290.  
  291.    7   not busy
  292.    6   acknowledge
  293.    5   out of paper
  294.    4   selected
  295.    3   I/O error
  296.    2   unused
  297.    1   unused
  298.    0   timeout
  299.  
  300.    Status% = BiosChkPrt%(Port%)
  301.  
  302.  
  303.  
  304. BiosComPorts%
  305.  
  306. This function returns the number of serial (com) ports
  307. installed.
  308.  
  309.    Ports% = BiosComPorts%
  310.  
  311. BiosCtrl%
  312.  
  313. This function tells you whether a Ctrl key is pressed.
  314.  
  315.    Ctrl% = BiosCtrl%
  316.  
  317.  
  318.  
  319. BiosELAlt%
  320.  
  321. This function tells you whether the left Alt key is pressed.
  322. It works only with "enhanced" keyboards.
  323.  
  324.    LAlt% = BiosELAlt%
  325.  
  326.  
  327.  
  328. BiosELCtrl%
  329.  
  330. This function tells you whether the left Ctrl key is pressed.
  331. It works only with "enhanced" keyboards.
  332.  
  333.    LCtrl% = BiosELCtrl%
  334.  
  335.  
  336.  
  337. BiosERAlt%
  338.  
  339. This function tells you whether the right Alt key is pressed.
  340. It works only with "enhanced" keyboards.
  341.  
  342.    RAlt% = BiosERAlt%
  343.  
  344.  
  345.  
  346. BiosERCtrl%
  347.  
  348. This function tells you whether the right Ctrl key is pressed.
  349. It works only with "enhanced" keyboards.
  350.  
  351.    RCtrl% = BiosERCtrl%
  352.  
  353.  
  354.  
  355. BiosESysRq%
  356.  
  357. This function tells you whether the SysRq key is pressed.  It
  358. works only with "enhanced" keyboards.
  359.  
  360.    SysRq% = BiosESysRq%
  361.  
  362. BiosFloppies%
  363.  
  364. This function returns the number of floppy drives installed.
  365.  
  366.    Floppies% = BiosFloppies%
  367.  
  368.  
  369.  
  370. BiosGetEKeyW$
  371.  
  372. This function reads a character from the keyboard.  It works
  373. like INKEY$, but waits until a key is pressed before returning.
  374.  
  375. Actually, it doesn't work quite like INKEY$, which is to its
  376. advantage.  It always returns a two-character string, where the
  377. first character is the ASCII code (CHR$(0) for extended keys,
  378. like function keys and arrow keys) and the second character is
  379. the scan code.  For normal keys, the scan code is always the
  380. same regardless of the shift state of the key.  That is, the
  381. scan code for "A" is the scan code for "a" is the scan code for
  382. Ctrl-A is the scan code for Alt-A.  Rose is a rose is a rose,
  383. eh?  This is an occasionally useful property.
  384.  
  385. Note that this keyboard service is for use with "enhanced"
  386. keyboards only. Use BiosGetKeyW$ for older keyboards.
  387.  
  388.    Ky$ = BiosGetEKeyW$
  389.  
  390.  
  391.  
  392. BiosGetKeyW$
  393.  
  394. This function reads a character from the keyboard.  It works
  395. like INKEY$, but waits until a key is pressed before returning.
  396.  
  397. Actually, it doesn't work quite like INKEY$, which is to its
  398. advantage.  It always returns a two-character string, where the
  399. first character is the ASCII code (CHR$(0) for extended keys,
  400. like function keys and arrow keys) and the second character is
  401. the scan code.  For normal keys, the scan code is always the
  402. same regardless of the shift state of the key.  That is, the
  403. scan code for "A" is the scan code for "a" is the scan code for
  404. Ctrl-A is the scan code for Alt-A.  Rose is a rose is a rose,
  405. eh?  This is an occasionally useful property.
  406.  
  407. Note that this keyboard service, for reasons known only to IBM,
  408. is designed to ignore the new key codes for "enhanced"
  409. keyboards.  This means it won't detect F11 or F12, for
  410. instance.  Use BiosGetEKeyW$ for enhanced keyboards.
  411.  
  412.    Ky$ = BiosGetKeyW$
  413.  
  414. BiosGetVideo
  415.  
  416. This routine returns information about the current video mode:
  417. the width of the screen (text columns), the screen mode, and
  418. the active display page.
  419.  
  420. The screen mode uses a different numbering system than BASIC
  421. (or, more properly, vice versa).  Standard BIOS screen modes
  422. are as follows:
  423.  
  424.   Mode    Type       Resolut.  Colr  Displ.      Adapter
  425.   ----  ---------    --------  ----  ------    -----------
  426.     0   text mode     40x25     16    mono     CGA/EGA/VGA
  427.     1   text mode     40x25     16    color    CGA/EGA/VGA
  428.     2   text mode     80x25     16    mono     CGA/EGA/VGA
  429.     3   text mode     80x25     16    color    CGA/EGA/VGA
  430.     4   graphics     320x200     4    color    CGA/EGA/VGA
  431.     5   graphics     320x200     4    mono     CGA/EGA/VGA
  432.     6   graphics     640x200     2    color    CGA/EGA/VGA
  433.     7   text mode     80x25     ..    mono     MDA/Herc
  434.    13   graphics     320x200    16    color    EGA/VGA
  435.    14   graphics     640x200    16    color    EGA/VGA
  436.    15   graphics     640x350     2    mono     EGA/VGA
  437.    16   graphics     640x350    16    color    EGA/VGA
  438.    17   graphics     640x480     4    mono     VGA
  439.    18   graphics     640x480    16    color    VGA
  440.    19   graphics     320x200   256    color    VGA
  441.  
  442.    BiosGetVideo Columns%, ScreenMode%, ActivePage%
  443.  
  444.  
  445.  
  446. BiosInitPrt%
  447.  
  448. This function initializes the selected printer.  It also
  449. returns the status of the printer. Status information is
  450. encoded at the bit level, as follows:
  451.  
  452.    7   not busy
  453.    6   acknowledge
  454.    5   out of paper
  455.    4   selected
  456.    3   I/O error
  457.    2   unused
  458.    1   unused
  459.    0   timeout
  460.  
  461.    Status% = BiosInitPrt%(Port%)
  462.  
  463. BiosIns%
  464.  
  465. This function tells you whether the Insert toggle is on.
  466.  
  467.    Ins% = BiosIns%
  468.  
  469.  
  470.  
  471. BiosJoyPosn
  472.  
  473. This routine returns the current joystick coordinates.  If only
  474. one joystick is installed, the second set of coordinates is
  475. meaningless, unless a FlightStick is in use.  The FlightStick
  476. has a "throttle" dial, the value for which is returned as the Y
  477. position of an imaginary second joystick.
  478.  
  479. Coordinates typically range from 0-400 or so.  It is a good
  480. idea to include a joystick calibration routine in your program
  481. since the numbers are likely to vary significantly.
  482.  
  483.    BiosJoyPosn Stick1X%, Stick1Y%, Stick2X%, Stick2Y%
  484.  
  485.  
  486.  
  487. BiosJoyPress
  488.  
  489. This routine tells you which joystick buttons are being
  490. pressed.  If only one joystick is installed, the second set of
  491. coordinates is meaningless.
  492.  
  493.    BiosJoyPress Stick1A%, Stick1B%, Stick2A%, Stick2B%
  494.  
  495.  
  496.  
  497. BiosKeyIn%
  498.  
  499. This function stuffs a key into the keyboard buffer.  It is for
  500. AT-type computers only.  You may stuff up to 15 keys into the
  501. normal buffer, depending on whether there are already any keys
  502. pending.  A -1 will be returned if the keyboard buffer was full
  503. and the key couldn't be stuffed.
  504.  
  505. The key specification must be as a two-character string.  The
  506. first character is the ASCII code and the second, the scan
  507. code.  In a pinch, you can usually get away with using CHR$(0)
  508. for the scan code, but it is better to include the scan code
  509. (use the BiosGetKeyW$ routine to find out the appropriate
  510. code).
  511.  
  512.    ErrCode% = BiosKeyIn%(Ky$)
  513.  
  514. BiosKeyRep
  515.  
  516. This routine allows you to change the key repeat rate on
  517. AT-type computers.  You must specify the delay before repeat:
  518. 0-3, for 250mS to 1 second.  You must also specify the repeat
  519. rate: 0-31, for 30/second to 2/second (12 is the default).
  520.  
  521.    BiosKeyRep RepDelay%, RepRate%
  522.  
  523.  
  524.  
  525. BiosLShift%
  526.  
  527. This function tells you whether the left Shift key is pressed.
  528.  
  529.    LShift% = BiosLShift%
  530.  
  531.  
  532.  
  533. BiosMHide
  534.  
  535. This routine hides the mouse cursor, making it invisible.
  536.  
  537.    BiosMHide
  538.  
  539.  
  540.  
  541. BiosMInit%
  542.  
  543. This function tells you whether a mouse is available.  If so,
  544. it returns the number of buttons the mouse has.  If not, it
  545. returns a zero.
  546.  
  547. This function should be used at the start of any program which
  548. expects to use a mouse.  You must not use any other mouse
  549. routine unless a mouse is available.  Besides that, BiosMInit%
  550. initializes the mouse driver to a proper starting state.
  551.  
  552.    Buttons% = BiosMInit%
  553.  
  554.  
  555.  
  556. BiosMLButton%
  557.  
  558. This function tells you whether the left mouse button is being
  559. pressed.
  560.  
  561.    Pressed% = BiosMLButton%
  562.  
  563. BiosMLClick
  564.  
  565. This routine tells you how many times the left mouse button has
  566. been pressed since the last time you checked.  It also returns
  567. the position of the mouse cursor as of the last left button
  568. press.
  569.  
  570. See BiosWhereX% and BiosWhereY% for information on the unusual
  571. handling of coordinates in text and CGA SCREEN 1 modes.
  572.  
  573.    BiosMLClick Clicks%, X%, Y%
  574.  
  575.  
  576.  
  577. BiosMLocate
  578.  
  579. This routine sets the position of the mouse cursor.  Note that
  580. coordinate handling is peculiar for text mode and SCREEN 1, for
  581. which a virtual screen of 640x200 is assumed.  This means that
  582. you will have to double your X coordinate when in SCREEN 1
  583. mode.  For text mode, first subtract one from each coordinate,
  584. then multiply the coordinate by eight.  Also keep in mind that
  585. for text mode the coordinates are normally Row, Column, but are
  586. here handled as if in graphics mode, so you need to use X, Y
  587. (or Column, Row) order instead.
  588.  
  589. This is another fine mess Microsoft's gotten us into!
  590.  
  591.    BiosMLocate X%, Y%
  592.  
  593.  
  594.  
  595. BiosMLRelease
  596.  
  597. This routine tells you how many times the left mouse button has
  598. been released since the last time you checked.  It also returns
  599. the position of the mouse cursor as of the last left button
  600. release.
  601.  
  602. See BiosWhereX% and BiosWhereY% for information on the unusual
  603. handling of coordinates in text and CGA SCREEN 1 modes.
  604.  
  605.    BiosMLRelease Releases%, X%, Y%
  606.  
  607.  
  608.  
  609. BiosMMButton%
  610.  
  611. This function tells you whether the middle mouse button is
  612. being pressed.  The results will not be meaningful on a
  613. two-button mouse.
  614.  
  615.    Pressed% = BiosMMButton%
  616.  
  617. BiosMMClick
  618.  
  619. This routine tells you how many times the middle mouse button
  620. has been pressed since the last time you checked.  It also
  621. returns the position of the mouse cursor as of the last middle
  622. button press.  The results will not be meaningful on a
  623. two-button mouse.
  624.  
  625. See BiosWhereX% and BiosWhereY% for information on the unusual
  626. handling of coordinates in text and CGA SCREEN 1 modes.
  627.  
  628.    BiosMMClick Clicks%, X%, Y%
  629.  
  630.  
  631.  
  632. BiosMMRelease
  633.  
  634. This routine tells you how many times the middle mouse button
  635. has been released since the last time you checked.  It also
  636. returns the position of the mouse cursor as of the last middle
  637. button release.  The results will not be meaningful on a
  638. two-button mouse.
  639.  
  640. See BiosWhereX% and BiosWhereY% for information on the unusual
  641. handling of coordinates in text and CGA SCREEN 1 modes.
  642.  
  643.    BiosMMRelease Releases%, X%, Y%
  644.  
  645.  
  646.  
  647. BiosMRButton%
  648.  
  649. This function tells you whether the right mouse button is being
  650. pressed.
  651.  
  652.    Pressed% = BiosMRButton%
  653.  
  654.  
  655.  
  656. BiosMRClick
  657.  
  658. This routine tells you how many times the right mouse button
  659. has been pressed since the last time you checked.  It also
  660. returns the position of the mouse cursor as of the last right
  661. button press.
  662.  
  663. See BiosWhereX% and BiosWhereY% for information on the unusual
  664. handling of coordinates in text and CGA SCREEN 1 modes.
  665.  
  666.    BiosMRClick Clicks%, X%, Y%
  667.  
  668. BiosMRRelease
  669.  
  670. This routine tells you how many times the right mouse button
  671. has been released since the last time you checked.  It also
  672. returns the position of the mouse cursor as of the last right
  673. button release.
  674.  
  675. See BiosWhereX% and BiosWhereY% for information on the unusual
  676. handling of coordinates in text and CGA SCREEN 1 modes.
  677.  
  678.    BiosMRRelease Releases%, X%, Y%
  679.  
  680.  
  681.  
  682. BiosMShow
  683.  
  684. This routine tries to make the mouse cursor visible.  However,
  685. the mouse driver maintains a visibility count, so if multiple
  686. calls were made to BiosMHide, it will take just as many calls to
  687. BiosMShow to really make the cursor visible.
  688.  
  689.    BiosMShow
  690.  
  691.  
  692.  
  693. BiosMWhereX%
  694.  
  695. This function tells you the X coordinate of the mouse cursor.
  696. This is expressed in graphics coordinates even when text mode
  697. is in use.  For normal text modes and both CGA modes, a virtual
  698. screen of 640x200 is assumed.  So, for 320x200 CGA mode, divide
  699. the coordinate by two.  For 80x25 text mode, divide it by
  700. eight.
  701.  
  702.    X% = BiosMWhereX%
  703.  
  704.  
  705.  
  706. BiosMWhereY%
  707.  
  708. This function tells you the Y coordinate of the mouse cursor.
  709. This is expressed in graphics coordinates even when text mode
  710. is in use.  For normal text modes and both CGA modes, a virtual
  711. screen of 640x200 is assumed.  So, for 80x25 text mode, divide
  712. it by eight.
  713.  
  714.    Y% = BiosMWhereY%
  715.  
  716.  
  717.  
  718. BiosMWindow
  719.  
  720. This routine restricts the mouse cursor to a specified area of
  721. the screen.  See BiosMLocate for a description of the unusual
  722. cursor handling in text modes and SCREEN 1 graphics mode.
  723.  
  724.    BiosMWindow X1%, Y1%, X2%, Y2%
  725.  
  726. BiosNum%
  727.  
  728. This function tells you whether the NumLock toggle is on.
  729.  
  730.    NumLock% = BiosNum%
  731.  
  732.  
  733.  
  734. BiosPrintCh%
  735.  
  736. This function sends a character to the selected printer.  It
  737. also returns the status of the printer. Status information is
  738. encoded at the bit level, as follows:
  739.  
  740.    7   not busy
  741.    6   acknowledge
  742.    5   out of paper
  743.    4   selected
  744.    3   I/O error
  745.    2   unused
  746.    1   unused
  747.    0   timeout
  748.  
  749.    Status% = BiosPrintCh%(Port%, Ch$)
  750.  
  751.  
  752.  
  753. BiosPrtPorts%
  754.  
  755. This function returns the number of parallel (printer) ports
  756. installed.
  757.  
  758.    Ports% = BiosPrtPorts%
  759.  
  760.  
  761.  
  762. BiosPrtSc
  763.  
  764. This routine sends the screen to the printer.  It works just
  765. like pressing PrtSc (PrintScreen) on your keyboard.
  766.  
  767. If you want to print a graphics screen, you need to load the
  768. GRAPHICS.COM TSR that came with DOS.  All versions of GRAPHICS
  769. support CGA graphics modes.  Not all of them support EGA or VGA.
  770.  
  771.    BiosPrtSc
  772.  
  773.  
  774.  
  775. BiosRShift%
  776.  
  777. This function tells you whether the right Shift key is pressed.
  778.  
  779.    RShift% = BiosRShift%
  780.  
  781. BiosScroll%
  782.  
  783. This function tells you whether the ScrollLock toggle is on.
  784.  
  785.    ScrollLock% = BiosScroll%
  786.  
  787.  
  788.  
  789. BiosScrollDn
  790.  
  791. This routine scrolls any part of the screen down.  You may
  792. specify the number of times to scroll.  If you specify 0, the
  793. area will be cleared instead of scrolled.  You must specify the
  794. colors to use on the new line(s) that was created by the
  795. scrolling action.
  796.  
  797.    BiosScrollDn TopRow%, LfCol%, BotRow%, RtCol%, Times%,
  798.       Fore%, Back%
  799.  
  800.  
  801.  
  802. BiosScrollUp
  803.  
  804. This routine scrolls any part of the screen up.  You may
  805. specify the number of times to scroll.  If you specify 0, the
  806. area will be cleared instead of scrolled.  You must specify the
  807. colors to use on the new line(s) that was created by the
  808. scrolling action.
  809.  
  810.    BiosScrollUp TopRow%, LfCol%, BotRow%, RtCol%, Times%,
  811.       Fore%, Back%
  812.  
  813.  
  814.  
  815. BiosXClose
  816.  
  817. This routine closes an area of XMS associated with a specified
  818. handle.  This must be done when you are finished using that
  819. area of XMS, so other routines and programs will be able to use
  820. it again later.
  821.  
  822.    BiosXClose Handle%
  823.  
  824.  
  825.  
  826. BiosXExists%
  827.  
  828. This function tells you whether an XMS driver is installed.
  829.  
  830.    XMS% = BiosXExists%
  831.  
  832. BiosXLFree&
  833.  
  834. This function tells you the size of the largest block of XMS
  835. memory that is available, in kilobytes.  Compare with
  836. BiosXTFree&.
  837.  
  838.    LargestFreeBlock& = BiosXLFree&
  839.  
  840.  
  841.  
  842. BiosXOpen
  843.  
  844. This routine opens an area of XMS memory for use.  The size is
  845. specified in kilobytes.  If the specified amount of space can
  846. be allocated, a handle is returned which you will use to access
  847. that block in the future.  If there is an error allocating that
  848. much memory, a non-zero error code will be returned.
  849.  
  850. Note that handles are a limited resource, so you should try to
  851. use as few of them as possible.
  852.  
  853. The maximum size theoretically possible under the XMS spec is
  854. 65,535 kilobytes (64 megabytes).  I haven't tried this in
  855. practice!
  856.  
  857.    BiosXOpen KBytes&, Handle%, ErrCode%
  858.  
  859.  
  860.  
  861. BiosXRead
  862.  
  863. This routine gets information from XMS memory.  You must
  864. specify the memory handle, the starting offset within the
  865. memory associated with that handle, and the number of bytes to
  866. transfer.  The number of bytes must be an EVEN number, but is
  867. not limited to 64k.  Finally, you must specify where to place
  868. the information as a segment and offset in conventional memory.
  869. For BASIC arrays and so forth, you can get this data using the
  870. VARSEG and VARPTR functions.
  871.  
  872. Another common place to put the data might be the display.  For
  873. text modes, this is a simple transfer.  Use an offset of 0 and
  874. a segment of either &HB000 (MDA/Herc) or &B800 (CGA/EGA/VGA).
  875.  
  876.    BiosXRead Handle%, Posn&, Bytes&, DSeg%, DOfs%
  877.  
  878. BiosXResize
  879.  
  880. This routine allows you to change the size of a previously
  881. allocated block of XMS memory.  You must specify the handle of
  882. the area to resize and the desired size, in kilobytes.  If
  883. unable to reallocate the block as specified, BiosXResize will
  884. return a non-zero error code.
  885.  
  886.    BiosXResize Handle%, Bytes&, ErrCode%
  887.  
  888.  
  889.  
  890. BiosXTFree&
  891.  
  892. This function returns the total amount of available XMS memory
  893. in kilobytes.  Compare with BiosXLFree&.
  894.  
  895.    TotalFree& = BiosXTFree&
  896.  
  897.  
  898.  
  899. BiosXVer%
  900.  
  901. This function returns the XMS driver version, multiplied by
  902. 100.  For instance, version 1.01 would be returned as 101.
  903.  
  904.    XMSver! = BiosXVer% / 100!
  905.  
  906.  
  907.  
  908. BiosXWrite
  909.  
  910. This routine puts information into XMS memory.  You must
  911. specify the memory handle, the starting offset within the
  912. memory associated with that handle, and the number of bytes to
  913. transfer.  The number of bytes must be an EVEN number, but is
  914. not limited to 64k.  Finally, you must specify where to get the
  915. information as a segment and offset in conventional memory. For
  916. BASIC arrays and so forth, you can get this data using the
  917. VARSEG and VARPTR functions.
  918.  
  919. Another common place from which to get the data might be the
  920. display.  For text modes, this is a simple transfer.  Use an
  921. offset of 0 and a segment of either &HB000 (MDA/Herc) or &B800
  922. (CGA/EGA/VGA).
  923.  
  924.    BiosXWrite Handle%, Posn&, Bytes&, DSeg%, DOfs%
  925.  
  926. DosBreak%
  927.  
  928. This function returns the current level of Break checking.  At
  929. level 0, DOS checks for Ctrl-C/Break only during keyboard input
  930. or screen output.  At level -1, DOS also checks during disk
  931. access.
  932.  
  933.    ExtendedBreak% = DosBreak%
  934.  
  935.  
  936.  
  937. DosBreakOff
  938.  
  939. This routine disables extended Break checking, so DOS only
  940. checks for Break during keyboard input or screen output.
  941.  
  942.    DosBreakOff
  943.  
  944.  
  945.  
  946. DosBreakOn
  947.  
  948. This routine enables extended Break checking, so DOS checks for
  949. Break during disk access as well as during keyboard input or
  950. screen output.
  951.  
  952.    DosBreakOn
  953.  
  954.  
  955.  
  956. DosDelDir%
  957.  
  958. This function deletes a directory.  The directory must be empty
  959. and must not be the current or root directory.  Unlike RMDIR,
  960. this function does not require an ON ERROR handler to cope with
  961. normal errors, as it returns an error code directly (0 if no
  962. error).  ON ERROR is only required if you need critical error
  963. handling.
  964.  
  965. The path name must be in ASCIIZ form, that is, with a CHR$(0)
  966. at the end.  This can be handled when the routine is called:
  967.  
  968.    ErrCode% = DosDelDir% (SubDir$ + CHR$(0))
  969.  
  970.  
  971.  
  972. DosDelFile%
  973.  
  974. This function deletes a file.  It takes up less space than the
  975. corresponding BASIC statement, KILL.  Unlike KILL, it does not
  976. require an ON ERROR handler to cope with normal errors, as it
  977. returns an error code directly (0 if no error).  ON ERROR is
  978. only required if you need critical error handling.
  979.  
  980. The filename must be in ASCIIZ form, that is, with a CHR$(0) at
  981. the end.  This can be handled when the routine is called:
  982.  
  983.    ErrCode% = DosDelFile% (File$ + CHR$(0))
  984.  
  985.  
  986.  
  987. DosDiskInfo
  988.  
  989. This routine returns an assortment of information about a given
  990. disk drive: sectors per cluster, free clusters, bytes per
  991. sector, and total clusters.  From this, you can derive further
  992. information such as how much disk space is available and the
  993. total disk space.
  994.  
  995. You may specify a null drive to get the information from the
  996. default drive.
  997.  
  998. If there was an error, SecsPerClus& will be -1.
  999.  
  1000.    DosDiskInfo Drive$, SecsPerClus&, FreeClus&, BytesPerSec&,
  1001.       TotalClus&
  1002.  
  1003.  
  1004.  
  1005. DosGetDay$
  1006.  
  1007. This function returns the current day of the week as a
  1008. three-character string.  For instance, on Wednesday the result
  1009. would be "Wed".
  1010.  
  1011.    Today$ = DosGetDay$
  1012.  
  1013. DosGetDir$
  1014.  
  1015. This function returns the default directory on the specified
  1016. drive.  If there was an error, a null string ("") will be
  1017. returned.
  1018.  
  1019. You may specify a null drive to get the directory of the
  1020. default drive.
  1021.  
  1022.    Subdir$ = DosGetDir$(Drive$)
  1023.  
  1024.  
  1025.  
  1026. DosGetDisk$
  1027.  
  1028. This function returns the letter of the currently selected
  1029. disk drive.
  1030.  
  1031.    Drive$ = DosGetDisk$
  1032.  
  1033.  
  1034.  
  1035. DosGetFAttr%
  1036.  
  1037. This function returns the file attributes of a specified file.
  1038. The file must be terminated by CHR$(0).  If there was an error,
  1039. -1 will be returned.  Otherwise, the result will be any
  1040. combination of the following, added together:
  1041.  
  1042.     1   read-only
  1043.     2   hidden
  1044.     4   system
  1045.     8   volume label
  1046.    16   subdirectory
  1047.    32   archive
  1048.  
  1049. The results can be most conveniently decoded using the AND
  1050. function.  For instance:
  1051.  
  1052.    IF DosGetFAttr%(File$ + CHR$(0)) AND 16 THEN
  1053.       PRINT "Subdirectory"
  1054.    END IF
  1055.  
  1056.  
  1057.  
  1058. DosGetKey$
  1059.  
  1060. This function attempts to read a character from DOS standard
  1061. input (normally the keyboard).  It works like INKEY$.
  1062.  
  1063. Standard input can be redirected from the command line, so it
  1064. may get information from a file or device instead of the
  1065. keyboard.  That is one of the advantages of this function.
  1066.  
  1067.    Ky$ = DosGetKey$
  1068.  
  1069. DosGetKeyW$
  1070.  
  1071. This function reads a character from DOS standard input
  1072. (normally the keyboard).  It works like INKEY$, but waits until
  1073. a key is pressed before returning.
  1074.  
  1075. Standard input can be redirected from the command line, so it
  1076. may get information from a file or device instead of the
  1077. keyboard.  That is one of the advantages of this function.
  1078.  
  1079.    Ky$ = DosGetKeyW$
  1080.  
  1081.  
  1082.  
  1083. DosGetVersion%
  1084.  
  1085. This function returns the DOS version multiplied by 100.  For
  1086. instance, DOS 2.11 would be returned as 211.
  1087.  
  1088.    DOSver! = DosGetVersion% / 100!
  1089.  
  1090.  
  1091.  
  1092. DosMakeDir%
  1093.  
  1094. This function creates a directory.  Unlike MKDIR, it does not
  1095. require an ON ERROR handler to cope with normal errors, as it
  1096. returns an error code directly (0 if no error).  ON ERROR is
  1097. only required if you need critical error handling.
  1098.  
  1099. The path name must be in ASCIIZ form, that is, with a CHR$(0)
  1100. at the end.  This can be handled when the routine is called:
  1101.  
  1102.    ErrCode% = DosMakeDir% (SubDir$ + CHR$(0))
  1103.  
  1104.  
  1105.  
  1106. DosRenFile%
  1107.  
  1108. This function renames a file, and/or moves it to a new
  1109. directory on the same drive.  It can't move a file across
  1110. drives.  It takes less space than NAME, and does not require an
  1111. ON ERROR handler to cope with normal errors, as it returns an
  1112. error code directly (0 if no error).  ON ERROR is only needed
  1113. if you require critical error handling.
  1114.  
  1115. The path name must be in ASCIIZ form, that is, with a CHR$(0)
  1116. at the end.  This can be handled when the routine is called:
  1117.  
  1118.    ErrCode% = DosRenFile% (OldFile$+CHR$(0), NewFile$+CHR$(0))
  1119.  
  1120.  
  1121.  
  1122. DosSetDir%
  1123.  
  1124. This function sets the default directory.  Unlike CHDIR, it
  1125. does not require an ON ERROR handler to cope with normal
  1126. errors, as it returns an error code directly (0 if no error).
  1127. ON ERROR is only required if you need critical error handling.
  1128.  
  1129. The path name must be in ASCIIZ form, that is, with a CHR$(0)
  1130. at the end.  This can be handled when the routine is called:
  1131.  
  1132.    ErrCode% = DosSetDir% (SubDir$ + CHR$(0))
  1133.  
  1134.  
  1135.  
  1136. DosSetDisk%
  1137.  
  1138. This function sets the default disk drive.  It also returns the
  1139. number of logical drives in the system.
  1140.  
  1141. Note that a logical drive may be considered being like a drive
  1142. letter-- it may refer to part of a larger physical drive, to a
  1143. RAMdisk, to some other device, or to nothing at all.
  1144.  
  1145.    LogicalDrives% = DosSetDisk% (Drive$)
  1146.  
  1147.  
  1148.  
  1149. DosSetFAttr%
  1150.  
  1151. This function sets the file attributes of a specified file.
  1152. The file must be terminated by CHR$(0).  If there was an error,
  1153. -1 will be returned.  Otherwise, 0 will be returned.
  1154.  
  1155. You may set any combination of the following attributes, added
  1156. together:
  1157.  
  1158.     1   read-only
  1159.     2   hidden
  1160.     4   system
  1161.    32   archive
  1162.  
  1163.    ErrCode% = DosSetFAttr%(File$ + CHR$(0), FAttr%)
  1164.  
  1165. DosVerify%
  1166.  
  1167. This function tells you whether disk write verification is
  1168. turned on.
  1169.  
  1170.    Verify% = DosVerify%
  1171.  
  1172.  
  1173.  
  1174. DosVerifyOff
  1175.  
  1176. This routine disables disk write verification.  Verification
  1177. provides better file security but slows things down.  It is
  1178. normally off by default.
  1179.  
  1180.    DosVerifyOff
  1181.  
  1182.  
  1183.  
  1184. DosVerifyOn
  1185.  
  1186. This routine enables disk write verification.  Verification
  1187. provides better file security but slows things down.  It is
  1188. normally off by default.
  1189.  
  1190.    DosVerifyOn
  1191.  
  1192.  
  1193.  
  1194. DosWriteSt
  1195.  
  1196. This routine writes a string to the DOS standard output
  1197. (normally the display).
  1198.  
  1199. Standard output can be redirected from the command line, so it
  1200. may write information to a file or device instead of the
  1201. display.  It also supports device drivers such as ANSI.SYS.
  1202. That is one of the advantages of this routine.
  1203.  
  1204.    DosWriteSt St$
  1205.  
  1206.